import React from 'react'
import { connect } from 'react-redux'

export const Home = ({ num, list, dispatch }) => {
    console.log(list)
    return (
        <div>
            Home---{ num }
            <button onClick={ () => {
                dispatch({ type: "CHANGE_COUNT" })
            }}>点我</button>
        </div>
    )
}

const mapStateToProps = (state) => {
    const { num, list } = state
    return {
        num,
        list
    }
}

// const mapDispatchToProps = {}

export default connect(mapStateToProps)(Home)